import axios from 'axios'
export function create_collect_action(param){
    return{
        type:'COLLECT',
        param
    }
}
export function create_cancelcollect_action(param){
    return{
        type:'CANCEL_COLLeCT',
        param
    }
}
export function create_ahopping_action(param){
    return{
        type:'AHOPPING',
        param
    }
}
export function create_cancelahopping_action(param){
    return{
        type:'CANCEL_AHOPPING',
        param
    }
}
export function create_requestlist_action(  ){
    return ( dispatch )=>{
        axios.get("/api/list").then((res)=>{
            dispatch( create_savelist_action( res.data.list ) )
        })
    }
}

export function create_savelist_action( param ){
    return {
        type: 'SAVE_LIST',
        param 
    }
}